{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2356391f",
   "metadata": {},
   "source": [
    "## [修改jupyter的工作路径](https://blog.csdn.net/yukinoai/article/details/83087221)\n",
    "第一种方式修改快捷方式中的起始位置，直接将其改为工作路径。但是现在的jupyter版本似乎不能使用该方式修改工作路径，测试失败。在安装jupyter时终端显示了一条调试信息：\n",
    "```txt\n",
    "\\ DEBUG menuinst_win32:__init__(198): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'D:\\Development\\Anaconda\\envs\\SciencePy', env_name: 'SciencePy', mode: 'user', used_mode: 'user'\n",
    "DEBUG menuinst_win32:create(323): Shortcut cmd is D:\\Development\\Anaconda\\python.exe, args are ['D:\\\\Development\\\\Anaconda\\\\cwp.py', 'D:\\\\Development\\\\Anaconda\\\\envs\\\\SciencePy', 'D:\\\\Development\\\\Anaconda\\\\envs\\\\SciencePy\\\\python.exe', 'D:\\\\Development\\\\Anaconda\\\\envs\\\\SciencePy\\\\Scripts\\\\jupyter-notebook-script.py', '\"%USERPROFILE%/\"']\n",
    "```\n",
    "快捷方式的参数有两个，第一个是\n",
    "```\n",
    "'D:\\\\Development\\\\Anaconda\\\\cwp.py', 'D:\\\\Development\\\\Anaconda\\\\envs\\\\SciencePy', 'D:\\\\Development\\\\Anaconda\\\\envs\\\\SciencePy\\\\python.exe'\n",
    "```\n",
    "第二个是  `\"%USERPROFILE%/\"`  ，这和jupyter快捷方式—>属性—>目标中的内容一致，可以猜测第二个参数是工作路径，因而我将jupyter快捷方式—>属性—>目标中的第二个参数改为工作路径，再次打开jupyter确实进入的是设定的工作路径。\n",
    "需要注意的是，快捷方式中可输入的字符串长度有限，第一个参数不可更改，当第一个参数长度过长时，需要注意第二个参数的长度。\n",
    "\n",
    "\n",
    "另一种修改工作路径的方式是在命令行中进入jupyter所在目录，执行`jupyter notebook --generate-config`，生成一个配置文件，在配置文件中设置工作目录。\n",
    "\n",
    "推荐第一种方式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5f91c2f4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
